using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SmartLink.Domain.Entity;
using SmartLink.Domain.IServices;
using SmartLink.IRepository;

namespace SmartLink.Domain.Services
{
    public class BIZ_UserToOrganizationServices : IBIZ_UserToOrganizationServices

    {
        private IBIZ_UserToOrganizationRepo _IBIZ_UserToOrganizationRepo;
        public BIZ_UserToOrganizationServices(IBIZ_UserToOrganizationRepo iBIZ_UserToOrganizationRepo)
        {
            _IBIZ_UserToOrganizationRepo = iBIZ_UserToOrganizationRepo;
        }
        /// <summary>
        /// 添加用户组织映射  
        /// </summary>
        /// <returns></returns>
        public bool AddUserOrgRelation(BIZ_UserToOrganization userToOrg)
        {
            dynamic id = _IBIZ_UserToOrganizationRepo.Add(userToOrg, null);
            if (id > 0)
                return true;
            return false;
        }

        public BIZ_UserToOrganization GetByUserId(int userId)
        {
            return _IBIZ_UserToOrganizationRepo.GetByUserId(userId);
        }
    }
}
